<template>
    <el-container>
        <el-tabs type="border-card" class="Wh" @tab-click="onClick">
            <el-tab-pane label="分发池" class="Wh">   
                <el-header>
                    <user-video-search :handleSearch="handleSearch" :tabE="3"></user-video-search>
                </el-header>
                <el-main class="main">
                    <user-video-list :vdData="vdDataF" :totalS="total" :tabE="3" :refreshFlag="refreshFlag"></user-video-list>
                </el-main>
            </el-tab-pane>
            <el-tab-pane label="推荐池" class="Wh">       
                <el-header>
                    <user-video-search :handleSearch="handleSearch" :tabE="4"></user-video-search>
                </el-header>
                <el-main class="main">
                    <user-video-list :vdData="vdDataT" :totalS="total" :tabE="tabP=4" :refreshFlag="refreshFlag"></user-video-list>
                </el-main>
            </el-tab-pane>
            <el-tab-pane label="低质量池" class="Wh">       
                <el-header>
                    <user-video-search :handleSearch="handleSearch" :tabE="5"></user-video-search>
                </el-header>
                <el-main class="main">
                    <user-video-list :vdData="vdDataD" :totalS="total" :tabE="tabP=5" :refreshFlag="refreshFlag"></user-video-list>
                </el-main>
            </el-tab-pane>
            <el-tab-pane label="运营下线" class="Wh">       
                <el-header>
                    <user-video-search :handleSearch="handleSearch" :tabE="6"></user-video-search>
                </el-header>
                <el-main class="main">
                    <user-video-list :vdData="vdDataX" :totalS="total" :tabE="tabP=6" :refreshFlag="refreshFlag"></user-video-list>
                </el-main>
            </el-tab-pane>
            <el-tab-pane label="用户自删" class="Wh">       
                <el-header>
                    <user-video-search :handleSearch="handleSearch" :tabE="7"></user-video-search>
                </el-header>
                <el-main class="main">
                    <user-video-list :vdData="vdDataS" :totalS="total" :tabE="tabP=7" :refreshFlag="refreshFlag"></user-video-list>
                </el-main>
            </el-tab-pane>
        </el-tabs>
    </el-container>
</template>

<script>
import userVideoSearch from './userVideoSearch.vue';
import userVideoList from './userVideoList.vue';
export default {
    data() {
    return {
        vdDataF: [],
        vdDataT:[],
        vdDataD:[],
        vdDataX:[],
        vdDataS:[],
        total:0,
        refreshFlag: false,
    };
  },
    components: {
        userVideoSearch:userVideoSearch,
        userVideoList:userVideoList,
    },
    created(){
        
    },
    methods: {
    handleSearch(res,bs) {
        if(bs==3){
            this.vdDataF = res.data.data.content
            this.total = res.data.data.totalSize
           
        }else if(bs==4){
            this.vdDataT = res.data.data.content
            this.total = res.data.data.totalSize
            
        }else if(bs==5){
            this.vdDataD = res.data.data.content
            this.total = res.data.data.totalSize
            
        }else if(bs==6){
            this.vdDataX = res.data.data.content
            this.total = res.data.data.totalSize
        }else{
            this.vdDataS = res.data.data.content
            this.total = res.data.data.totalSize
        }
    },

    onClick() {
        // 切换 refreshFlag 的值来触发 video-list 组件刷新
        this.refreshFlag = !this.refreshFlag;
    }
    
  }
}
</script>

<style scoped>
.main{
    margin-top: 40px;
}
.Wh{
    width: 100%;
}
</style>